export const validateEmail = (rule, value, callback) => {
  const reg = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/
  if (reg.test(value)) {
    callback()
  } else {
    callback(new Error('请输入正确的邮箱格式'))
  }
}

export const validatePassword = (rule, value, callback) => {
  const reg = /(?=.*[a-zA-Z])(?=.*\d).{10,18}/
  if (reg.test(value)) {
    callback()
  } else {
    callback(new Error('密码必须包含字母和数字且10~18位'))
  }
}
